package db;

// Generated 12.06.2012 19:50:00 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Person generated by hbm2java
 */
@Entity
@Table(name = "person")
public class Person implements java.io.Serializable {

	private int person;
	private Employee employeeByUpdatedBy;
	private Employee employeeByCreatedBy;
	private String firstName;
	private String lastName;
	private String identityCode;
	private Date birthDate;
	private Date created;
	private Date updated;
	private Set<EnterprisePersonRelation> enterprisePersonRelations = new HashSet<EnterprisePersonRelation>(
			0);
	private Set<Employee> employees = new HashSet<Employee>(0);

	public Person() {
	}

	public Person(int person) {
		this.person = person;
	}

	public Person(int person, Employee employeeByUpdatedBy,
			Employee employeeByCreatedBy, String firstName, String lastName,
			String identityCode, Date birthDate, Date created, Date updated,
			Set<EnterprisePersonRelation> enterprisePersonRelations,
			Set<Employee> employees) {
		this.person = person;
		this.employeeByUpdatedBy = employeeByUpdatedBy;
		this.employeeByCreatedBy = employeeByCreatedBy;
		this.firstName = firstName;
		this.lastName = lastName;
		this.identityCode = identityCode;
		this.birthDate = birthDate;
		this.created = created;
		this.updated = updated;
		this.enterprisePersonRelations = enterprisePersonRelations;
		this.employees = employees;
	}

	@Id
	@Column(name = "person", unique = true, nullable = false)
	public int getPerson() {
		return this.person;
	}

	public void setPerson(int person) {
		this.person = person;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updated_by")
	public Employee getEmployeeByUpdatedBy() {
		return this.employeeByUpdatedBy;
	}

	public void setEmployeeByUpdatedBy(Employee employeeByUpdatedBy) {
		this.employeeByUpdatedBy = employeeByUpdatedBy;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "created_by")
	public Employee getEmployeeByCreatedBy() {
		return this.employeeByCreatedBy;
	}

	public void setEmployeeByCreatedBy(Employee employeeByCreatedBy) {
		this.employeeByCreatedBy = employeeByCreatedBy;
	}

	@Column(name = "first_name", length = 100)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "last_name", length = 100)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "identity_code", length = 20)
	public String getIdentityCode() {
		return this.identityCode;
	}

	public void setIdentityCode(String identityCode) {
		this.identityCode = identityCode;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "birth_date", length = 13)
	public Date getBirthDate() {
		return this.birthDate;
	}

	public void setBirthDate(Date birthDate) {
		this.birthDate = birthDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created", length = 29)
	public Date getCreated() {
		return this.created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "updated", length = 29)
	public Date getUpdated() {
		return this.updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "person")
	public Set<EnterprisePersonRelation> getEnterprisePersonRelations() {
		return this.enterprisePersonRelations;
	}

	public void setEnterprisePersonRelations(
			Set<EnterprisePersonRelation> enterprisePersonRelations) {
		this.enterprisePersonRelations = enterprisePersonRelations;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "person")
	public Set<Employee> getEmployees() {
		return this.employees;
	}

	public void setEmployees(Set<Employee> employees) {
		this.employees = employees;
	}

}
